package com.study.design.model.createPattern.builder;

/**
* @Name: LcAirShipDirector
* @Description: lc-牌宇宙飞船装配器
* @Author: 李超	lc_jack@foxmail.com
* @CreateDate: 2017-2-10 下午6:30:51 
* @Version: V1.0
 */
public class LcAirShipDirector implements AirShipDirector {
	
	private AirShipBuilder builder ;

	public LcAirShipDirector(AirShipBuilder builder) {
		this.builder = builder;
	}

	@Override
	public AirShip directAirShip() {
		//构建轨道舱组件
		OrbitalModule orbitalModule = builder.buildOrbitalModule() ;
		System.out.println("轨道舱组件组装成功！");
		//构建发动机组件
		Engine engine = builder.buildEngine() ;
		System.out.println("发动机组件组装成功！");
		//构建逃逸塔组件
		EscapeTower escapeTower = builder.buildEscapeTower() ;
		System.out.println("逃逸塔组件组装成功！");
		//组装成宇宙飞船
		AirShip airShip = new AirShip(orbitalModule, engine, escapeTower) ;
		System.out.println("宇宙飞船组装成功！");
		return airShip;
	}
	
	

}
